package com.xxin.controller;

import com.xxin.pojo.entity.Department;
import com.xxin.resp.Result;
import com.xxin.service.DepartmentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author 小欣
 * @version 1.0
 * @since 1.8
 */
@Controller
@RequestMapping("/api/department")
public class DepartmentController {
	
	@Resource
	private DepartmentService departmentService;
	
	
	@GetMapping("/getDepartmentList.json")
	@ResponseBody
	public Result<List<Department>> getDepartmentList(){
		List<Department> departmentList = departmentService.getDepartmentList();
		return Result.success(departmentList);
	}
}
